'use strict';
/**
 * 统计账目
 * accountAddress  记账合约地址  
 * userAddress     用户地址
 * balance         余额
 * freezeBalance   消费
 *  */
module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, DATE, STRING } = Sequelize;
    await queryInterface.createTable('accounts', {
        id: { type: INTEGER, primaryKey: true, autoIncrement: true },
        accountAddress: { type: STRING, allowNull: false },
        userAddress:  { type: STRING, allowNull: false, unique:true },
        balance:  { type: INTEGER, allowNull: false },// BIGINT
        freezeBalance:  { type: INTEGER, allowNull: false } // BIGINT
    
    });
  },
  // 在执行数据库降级时调用的函数，删除 actions 表
  down: async queryInterface => {
      await queryInterface.dropTable('accounts');
  },
};
